package com.catsic.pub.drawer.service;

import java.util.List;

import com.catsic.base.BaseService;
import com.catsic.base.tree.TreeInfo;
import com.catsic.pub.entity.Drawer;
import com.catsic.pub.form.DrawerForm;

public interface DrawerService extends BaseService <Drawer, String> {

	/**
	 * 添加
	 * @param form
	 * @return
	 */
	public DrawerForm add(DrawerForm form);
	
	/**
	 * 更新
	 * @param form
	 * @return
	 */
	public DrawerForm update(DrawerForm form);
	
	/**
	 * 注销
	 * @param id
	 * @return
	 */
	public void cancel(String id);
	
	/**
	 * 恢复节点
	 * @param id
	 * @return
	 */
	public void recover(String id);
	
	/**
	 * 激活节点
	 * @param id
	 * @return
	 */
	public void active(String id);
	
	/**
	 * 通过id获取抽屉
	 * @param drawer
	 * @return
	 */
	public Drawer findById(String id);
	
	/**
	 * 通过id获取抽屉
	 * @param drawer
	 * @return
	 */
	public DrawerForm findDrawerById(String id);
	
	/**
	 * 获取树数据
	 * @param 
	 */
	public List<TreeInfo> getTreeInfo();
	
	/**
	 * 通过父ID取得子节点
	 * @param 
	 */
	public List<DrawerForm> query(String id);
	
	/**
	 * findByPid:通过父节点ID获取子节点
	 * @author yangyd
	 * @param code
	 * @return
	 */
	public List<Drawer> findByPid(String id);
	
	/**
	 * findByParentCode:通过父节点编码获取子节点
	 * @author yangyd
	 * @param code
	 * @return
	 */
	public List<DrawerForm> findByParentCode(String code);
	
	/**
	 * findDrawerByCode:通过节点编码获取节点,转换为form
	 * @author yangyd
	 * @param code
	 * @return
	 */
	public DrawerForm findDrawerByCode(String code);
	
	/**
	 * findByCode:通过节点编码获取节点
	 * @author yangyd
	 * @param code
	 * @return
	 */
	public Drawer findByCode(String code);
	
	/**
	 * 通过父节点和值获取子节点
	 * @param parentCode
	 * @param value
	 * @return
	 */
	public Drawer findByParentAndValue(String parentCode,String value);
}
